using System.Runtime.InteropServices;
using System;

[Serializable]
[StructLayout(LayoutKind.Sequential)]
public partial struct Byte2 : IEquatable<Byte2> {
	public byte X;
	public byte Y;

	public Byte2(byte x, byte y) {
		X = x;
		Y = y;
	}

	public Byte2 Zero {
		get {
			return new Byte2(0, 0);
		}
	}

	public override bool Equals(object obj) {
		return Equals((Byte2)obj);
	}

	public bool Equals(Byte2 other) =>
		X == other.X && Y == other.Y;

	public override int GetHashCode() {
		return 256 * X + Y;
	}
}


[Serializable]
[StructLayout(LayoutKind.Sequential)]
public partial struct Byte3 : IEquatable<Byte3> {
	public byte X;
	public byte Y;
	public byte Z;

	public Byte3(byte x, byte y, byte z) {
		X = x;
		Y = y;
		Z = z;
	}

	public static Byte3 Zero {
		get {
			return new Byte3(0, 0, 0);
		}
	}

	public bool Equals(Byte3 other) {
		return X == other.X && Y == other.Y && Z == other.Z;
	}
}
